<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件按钮区分</title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
		</style>
	</head>
	<body>
		<div class="wrapper" style="width:100px;height:100px ;background: red;
		margin-top:50px;margin-left:10px;">事件按钮区分
		</div>
		<script type="text/javascript">
			var wrapper = document.getElementsByClassName("wrapper")[0];
			document.onmousedown=function(e){
				
				if(e.button==2){
					console.log("右键2")
				}else if(e.button==1){
					console.log("滑轮点击 1")
				}else{
					console.log("左键0")
				}
			}
			//document.onmouseup
		</script>
	</body>
</html>
